[C# .NET6] AutoFac ADD implementation after DI Container Resolve


If you want to Add a implementation after DI Container resolved already,
you need to create a newBuilder and Update it to the original Container.

                var newBuilder = new ContainerBuilder();
                newBuilder.Register(c =>  new Car {Seats = GetSeats().Split(',') }).As<ICar>();
                newBuilder.Update(OriginalDIContainer);
#C# #.net6 #.net






你可能感興趣的文章

Dcat-admin 可設定Grid的行操作按鈕 在第二欄或預設最後一欄

Dcat-admin 可設定Grid的行操作按鈕 在第二欄或預設最後一欄

5. 隊列(Queue)

5. 隊列(Queue)

W19_產品開發流程_學習筆記

W19_產品開發流程_學習筆記






留言討論